﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bizall.Dynamic.Aspect;

namespace DynamicAspectTester.Mocks
{
    class MyDisabledAspact :AspectBase
    {
        public MyDisabledAspact()
        {
            Enabled = false;
        }
        
        public override void OnAfterMethodCall(WeavingContext context)
        {
            //the method is never called because aspect has been disabled.
            if (context.ReturnValue != null && context.ReturnValue.GetType() == typeof(string))
                context.ReturnValue =  "I am here!";
        }
    }
}
